/*
 * @Author: 田鑫
 * @Date: 2023-02-21 15:09:11
 * @LastEditors: 田鑫
 * @LastEditTime: 2023-03-05 19:21:56
 * @Description:
 */
const TOKEN_KEY = 'satoken';

const isLogin = () => {
  return !!localStorage.getItem(TOKEN_KEY);
};

const getToken = () => {
  return localStorage.getItem(TOKEN_KEY);
};
const setToken = (token: string) => {
  localStorage.setItem(TOKEN_KEY, token);
};
const clearToken = () => {
  localStorage.removeItem(TOKEN_KEY);
};
const clearAllLocalStorage = () => {
  localStorage.clear();
};
export { isLogin, getToken, setToken, clearToken, clearAllLocalStorage };
